package com.zm.se.listenner;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.zm.se.entity.Price;
import com.zm.se.mapper.EquipmentMapper.EquMapper;

public class PriceExcelListener  extends AnalysisEventListener<Price> {

    private EquMapper mapper;

    public PriceExcelListener(EquMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public void invoke(Price price, AnalysisContext analysisContext) {
        System.out.println(price);
        System.out.println(mapper.insertPrice(price));
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.err.println("finish");
    }
}
